

import 'dart:async';

import 'package:dolqun_movies/UI/Pages/MainPage.dart';
import 'package:dolqun_movies/UI/Widgets/MyAnimatedRoute.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

class SplashScreen extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _SplashScreenPage();
}

class _SplashScreenPage extends State<SplashScreen> {
  @override
  void initState() {
    SchedulerBinding.instance.addPostFrameCallback((_) {
      Timer timer;
      timer = Timer(Duration(seconds: 1), (){
        timer.cancel();
        Navigator.of(context).pushReplacement(MyAnimatedRoute(builder: (context) => MainPage(),));
      });
    });
    super.initState();
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.blue,
      body: Center(
        child: Text("WELCOME", style: TextStyle(color: Colors.white, fontSize: 24.0),),
      ),
    );
  }
}